package cn.hn.tx.usermanager.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.hn.comm.ibatis.BaseDAO;
import cn.hn.tx.usermanager.model.PublishBlogUser;
import cn.hn.tx.usermanager.service.IUserManagerService;

public class UserManagerServiceImpl implements IUserManagerService {

	final String NAMESPACE="cn.hn.tx.usermanager.dao";
	
	//DAO基类
	private BaseDAO baseDAO;	
	
	public static void main(String[] args) 
	{
		List<String> exceptUid=new ArrayList<String>();
		exceptUid.add("1");
		exceptUid.add("2");
		exceptUid.add("3");
		
		String except="";
		for(int i=0;i<exceptUid.size();i++)
		{
			except+="\'"+exceptUid.get(i)+"\'";
			if(i!=exceptUid.size()-1)
			{
				except+=",";
			}
		}
		System.out.println(except);
	}
	
	public 	List<PublishBlogUser> queryPublishBlogUserListByExcept(int en_able,int type,List<String> exceptUid)
	{
		Map params=new HashMap<String,Object>();
		params.put("en_able", en_able);
		params.put("type", type);
		String except="";
		for(int i=0;i<exceptUid.size();i++)
		{
			except+="\'"+exceptUid.get(i)+"\'";
			if(i!=exceptUid.size()-1)
			{
				except+=",";
			}
		}

		params.put("exceptUid", except);
		return (List<PublishBlogUser>)baseDAO.queryList(NAMESPACE, "queryPublishBlogUserListByExcept", params);
	}
	
	public List<PublishBlogUser> queryPublishBlogUserList(int en_able) {
		PublishBlogUser pbu=new PublishBlogUser();
		pbu.setEn_able(en_able);
		return (List<PublishBlogUser>)baseDAO.queryList(NAMESPACE, "queryPublishBlogUserList", pbu);
	}

	public List<PublishBlogUser> queryPublishBlogUserListByType(int en_able,int type) {
		PublishBlogUser pbu=new PublishBlogUser();
		pbu.setEn_able(en_able);
		pbu.setType(type);
		return (List<PublishBlogUser>)baseDAO.queryList(NAMESPACE, "queryPublishBlogUserListByType", pbu);
	}
	
	
	public BaseDAO getBaseDAO() {
		return baseDAO;
	}

	public void setBaseDAO(BaseDAO baseDAO) {
		this.baseDAO = baseDAO;
	}
}
